<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="app">
        <img src="images/0.png" alt="">
        <img src="images/0.png" alt="">
        <span>:</span>
        <img src="images/0.png" alt="">
        <img src="images/0.png" alt="">
        <span>:</span>
        <img src="images/0.png" alt="">
        <img src="images/0.png" alt="">
    </div>
    <script>
        var img = document.querySelectorAll(".app img");
        function showTime(){
            var nowTime = new Date();
            var hours = nowTime.getHours();
            var minutes = nowTime.getMinutes();
            var seconds = nowTime.getSeconds();
            var countTime = num(hours)+num(minutes)+num(seconds);
            for (let i=0;i<img.length;i++){
                img[i].src = `images/${countTime[i]}.png`
            }
            setTimeout(function(){
                showTime();
            },1000)
        }
        function num(num){
            if (num<10){
                return num = "0"+num;
            }
            return num = ""+num;
        }
        showTime()
    </script>
</body>
</html>